package com.pkx.cloud.fse7.dms.tcm.service.impl;

import com.pkx.cloud.fse7.dms.tcm.entity.Tcm;
import com.pkx.cloud.fse7.dms.tcm.repo.TcmMapper;
import com.pkx.cloud.fse7.dms.tcm.service.TcmService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 *  服务实现类
 *
 * @author chenwg
 * @since 2020-11-12
 */
@Service
public class TcmServiceImpl extends ServiceImpl<TcmMapper, Tcm> implements TcmService {

    /**
     * 分页列表
     *
     * @param tcm
     * @return
     */
    @Override
    public Page<Tcm> pageList(Page page, Tcm tcm) {
        LambdaQueryWrapper<Tcm> lambdaQueryWrapper = Wrappers.lambdaQuery(Tcm.class);
        return page(page, lambdaQueryWrapper);
    }

    /**
     * 列表查询
     *
     * @param tcm
     * @return
     */
    @Override
    public List<Tcm> listByEntity(Tcm tcm) {
        LambdaQueryWrapper<Tcm> lambdaQueryWrapper = Wrappers.lambdaQuery(Tcm.class);
        return list(lambdaQueryWrapper);
    }

    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public Tcm selectById(Long id) {
        return getById(id);
    }

    /**
     * 保存
     *
     * @param tcm
     * @return
     */
    @Override
    public Boolean saveTcm(Tcm tcm) {
        return save(tcm);
    }

    /**
     * 修改
     *
     * @param tcm
     * @return
     */
    @Override
    public Boolean modify(Tcm tcm) {
        return updateById(tcm);
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Override
    public Boolean deleteById(Long id) {
        return removeById(id);
    }
}
